//
//  RW_MixedViewModel.m
//  SleepApp
//
//  Created by MAC on 2021/3/22.
//  Copyright © 2021 RiceWang. All rights reserved.
//

#import "RW_MixedViewModel.h"
#import "RW_MixedAudioModel.h"

@implementation RW_MixedViewModel
-(void)setSongList:(NSArray<RW_SongModel *> *)songList{
    _songList = songList;
    [_songList each:^(RW_SongModel *songModel, NSInteger idx) {
        RW_MixedAudioModel *model = [[RW_MixedAudioModel alloc]init];
        model.song_model = songModel;
        
        RW_MixedAudioView *view = [[RW_MixedAudioView alloc]init];
        view.audio_model = model;
        [self.mixed_audio_view_array addObject:view];
    }];
}

#pragma mark -- 懒加载
-(NSMutableArray<RW_MixedAudioView *> *)mixed_audio_view_array{
    if (!_mixed_audio_view_array){
        _mixed_audio_view_array = [NSMutableArray array];
    }
    return _mixed_audio_view_array;
}
#pragma mark -- 主动操作功能
/** 停止播放 */
-(void)stopPlay{
    [self.mixed_audio_view_array each:^(RW_MixedAudioView *view, NSInteger idx) {
        [view stopPlay];
    }];
}
@end
